<!DOCTYPE html>
<html >
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <a href="https://baidu.com">百度</a>
    <span id="net">网易</span>
    <span id="back">后退</span>
    <span id="go">前进</span>
</body>
<script>
    console.log(window.navigator);
    
     document.querySelector('#net')
            .addEventListener('click',e =>{
               // location.href="http://www.163.com";
               location.assign("http://www.163.com");
            });
    document.querySelector('#back')  
            .addEventListener('click',e =>{
                history.back();
            });
     document.querySelector('#go')  
            .addEventListener('click',e =>{
                history.forward();
            }) ;                
</script>
</html>